<template>
  <div>
    <h2>免费计算你的身体质量指数 (BMI)</h2>
    <div>
      <span>我的身高:</span>
      <input v-model="bmiForm.height">
    </div>
    <div>
      <span>我的体重:</span>
      <input v-model="bmiForm.weight">
    </div>
    <button @click="handleSubmit">计算BMI</button>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const bmiForm = ref({
  height: '',
  weight: ''
})


const emit = defineEmits([ 'my-submit' ])
const handleSubmit = () => {
  emit('my-submit', bmiForm)
}
</script>
